from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')
browser = webdriver.Chrome(options=chrome_options)

browser.implicitly_wait(10)

keyword = "真无线耳机"
page = 1
url = 'https://search.jd.com/Search?keyword=%s&enc=utf-8&page=%d' % (keyword, page)

print(url)

browser.get(url)

print(browser.page_source)
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=5
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=7
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=9
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=11
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=13
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=15
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=25
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=27
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=29
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=31
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=33
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=35
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=45
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=47
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=49
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=51
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=53
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=55
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=59
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=65
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=67
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=69
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=71
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=73
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=75
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=79
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=81
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=83
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=85
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=87
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=89
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=97
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=99
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=101
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=103
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=105
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=107
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=109
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=111
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=113
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=115
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=117
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=119
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=127
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=129
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=131
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=133
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=135
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=137
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=139
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=141
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=143
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=145
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=147
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=149
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=151
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=153
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=155
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=157
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=159
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=161
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=171
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=173
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=175
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=177
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=179
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=181
#
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=187
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=189
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=191
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=193
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=195
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=197
# https://search.jd.com/Search?keyword=真无线耳机&enc=utf-8&page=199
